#!/bin/sh

LOGS=/logs/current

TAPENUM=`ls $LOGS/comparing`
echo "Compare unloading $TAPENUM"
/sbin/mtx unload $TAPENUM 1
mv $LOGS/comparing/$TAPENUM $LOGS/done_compare

while [ `ls $LOGS/done_create | wc -l` = "0" ]
do
  sleep 5
done

TAPENUM=`ls -1 $LOGS/done_create | head -1`

echo "Compare loading $TAPENUM"
mv $LOGS/done_create/$TAPENUM $LOGS/comparing
/sbin/mtx load $TAPENUM 1

